<template>
	<div>
		<el-steps :active="active" finish-status="success" simple style="margin-top: 20px">
			<el-step title="1. 确认回报内容"></el-step>
			<el-step title="2. 生成订单"></el-step>
			<el-step title="3. 完成"></el-step>
		</el-steps>
		<hr />
		<div id="xxx1" style="text-align: center;">
			<h2>生成订单编号为:<span style="color:red">{{uuid}}</span></h2>
			<el-link href="/index" style="font-size:25px; color: #00FF00;">返回首页</el-link>

		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				active: 3,
				uuid: ''

			};
		},
		methods: {
			GetUrlParam(paraName) {
				var url = document.location.toString();
				var arrObj = url.split("?");

				if (arrObj.length > 1) {
					var arrPara = arrObj[1].split("&");
					var arr;

					for (var i = 0; i < arrPara.length; i++) {
						arr = arrPara[i].split("=");

						if (arr != null && arr[0] == paraName) {
							return arr[1];
						}
					}
					return "";
				} else {
					return "";
				}
			},
			async xx() {
				this.uuid = this.GetUrlParam("out_trade_no")
				unescape(this.uuid)
				var res = await this.$http.get("returnUrl?uuid=" + this.uuid);
				if (res.data.code == 203) {
					this.$message.success("付款完成")
				}
				console.log(this.uuid);
			},
		},
		mounted() {
			this.xx();
		},
	};
</script>

<style scoped>
	h2 {
		margin: 100px auto;
		text-align: center;
	}
</style>
